'''
Created on 31.1.2012

@author: mphkh
'''

from CashFlowUtils.IceBonds import *
from Calendar.Iceland import *
from datetime import date
from datetime import timedelta

print "shit shit"

ddate1 = date(2012,3,20)
ddate2 = date(2016,10,13)

bond1 = RIKB161013()
bond2 = RIKB190226()

b1yld = 0.0532
b2yld = 0.0676

cf1 = bond1.remaining_cashflows_todate(ddate1, ddate2)
cf2 = bond2.remaining_cashflows_todate(ddate1, ddate2)

for obj in cf1:
    print obj.yearfrac, obj.cfdate, obj.daysPeriod, obj.amount, obj.notional, obj.interests, obj.amortization
    
for obj in cf2:
    print obj.yearfrac, obj.cfdate, obj.daysPeriod, obj.amount, obj.notional, obj.interests, obj.amortization

b2yld = 0.069
print bond2.duration(ddate2, b2yld)


remainingcfs = []
remainingcfs.append("shit1")
remainingcfs.append("shit2")

print len(remainingcfs)

print bond1.description

a = geniusdescrtobond("RIKB 31 0124")
print a.description